﻿<script src="~/lib/vue/dist/vue.global.js"></script>
<script src="~/lib/axios/dist/axios.js"></script>
<link href="~/lib/element-plus/dist/index.css" rel="stylesheet" />
<script src="~/lib/element-plus/dist/index.full.js"></script>
<link href="~/css/table.css" rel="stylesheet" />
<div id="app">
	<table width="100%">
		<tr>
			<td>
				<p color="black">
					您正在做的业务是：人力资源--招聘管理--简历管理--有效简历列表 <br />
					符合条件的人力资源档案总数：{{rows}}例
				</p>
			</td>
		</tr>
		<tr>
			<td align="right">
				<input type="button" value="返回" class="BUTTON_STYLE1"
					   onclick="history.back();">
			</td>
		</tr>
	</table>
	<el-table :data="tableData" :header-cell-style="{background:'#FFDB6F',color:'#606266'}">
		<el-table-column prop="resId" label="档案编号">
			<template #default="{row}">
				<span v-if="row.checkStatus==2">
					<a href="#" v-on:click="handleEdit(row)">{{row.resId}}</a>
				</span>
			</template>
		</el-table-column >
		<el-table-column prop="humanName" label="姓名"></el-table-column>
		<el-table-column prop="humanSex" label="性别"></el-table-column>
		<el-table-column prop="humanMajorKindName" label="职位分类"></el-table-column>
		<el-table-column prop="hunmaMajorName" label="职位名称"></el-table-column>
		<el-table-column prop="humanTelephone" label="电话号码"></el-table-column>
		<el-table-column label="复核状态">
			<template #default="{row}">
				<span v-if="row.checkStatus==2">
					<a>通过</a>
				</span>
			</template>
		</el-table-column>
		<el-table-column label="面试状态">
			<template #default="{row}">
				<span v-if="row.interviewStatus==1">
					<a>待面试</a>
				</span>
			</template>
		</el-table-column>
	</el-table>
	<el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize"
				   :page-sizes="[5, 10, 15, 20]" layout="total, sizes, prev, pager, next, jumper" :total="rows"
				   v-on:size-change="handleSizeChange" v-on:current-change="handleCurrentChange">

	</el-pagination>
</div>
<script type="text/javascript">
	var { createApp, reactive, ref, computed, watchEffect } = Vue
	var app = createApp({
		setup() {
			const urlParams = new URLSearchParams(window.location.search);
			const rowData = JSON.parse(urlParams.get('ERS'));
			const rows = ref(0);
			const currentPage = ref(1);
			const pageSize = ref(2);
			const isUse = ref(false);
			let tableData = ref([])

			const fetchData = () => {
				axios.defaults.headers["Content-Type"] = "application/x-www-form-urlencoded";
				axios.post('/FYERSS', {
					HumanMajorKindId: rowData.zwfl,
					HumanMajorId: rowData.zwmc,
					gzc: rowData.gjz,
					startDate: rowData.sjy,
					endDate: rowData.sje,
					page: currentPage.value,
					pageSize: pageSize.value
				})
					.then(res => {
						tableData.value = res.data.er;
						rows.value = res.data.totalRecords;
						console.log(res.data.er)
					})
			};

			// 处理每页显示数量变化
			const handleSizeChange = (size) => {
				pageSize.value = size;
				fetchData();
				isUse.value = true;
			};

			// 处理当前页变化
			const handleCurrentChange = (cpage) => {
				currentPage.value = cpage;
				fetchData();
				isUse.value = true;
			};
			function handleEdit(row) {
				const queryParams = new URLSearchParams();
				queryParams.set('rowData', JSON.stringify(row));
				window.location.href = `/ERSS/Index2?${queryParams.toString()}`;
			}
			fetchData();
			return {
				tableData,
				currentPage,
				pageSize,
				rows,
				isUse,
				handleSizeChange,
				handleCurrentChange,
				handleEdit
			}
			return {

			}
		}
	})
	app.use(ElementPlus)
	app.mount("#app")
</script>

